
Version:=1.0
ModuleName:=nettools

Objcet:=$(ModuleName).tgz
ObjectDir:=

DependFiles:=bridge rzsz vlan ethtool mii-diag pciutils eepro100-diag tcpdump

InstallSbin:=usr/local/sbin
InstallBin:=usr/local/bin
InstallLib:=usr/local/lib

.PHONY: all clean dist_clean  $(Objcet)

all:$(Objcet)

$(Objcet):$(DependFiles)
	$(MAKE) -C bridge
	$(MAKE) -C rzsz
	$(MAKE) -C vlan
	$(MAKE) -C ethtool
	$(MAKE) -C mii-diag
	$(MAKE) -C pciutils
	$(MAKE) -C eepro100-diag
	$(MAKE) -C tcpdump
	mkdir -p $(InstallSbin)
	mkdir -p $(InstallBin)
	mkdir -p $(InstallLib)
	# for bridge
	cp -rf bridge/tmp/usr/local/sbin/brctl $(InstallSbin)
	# for rzsz
	cp -rf rzsz/tmp/usr/local/bin/* $(InstallBin)
	# for vlan
	cp -rf vlan/tmp/usr/local/sbin/* $(InstallSbin)
	# for ethtool
	cp -rf ethtool/tmp/usr/local/sbin/* $(InstallSbin)
	# for mii-diag
	cp -rf mii-diag/mii-diag $(InstallSbin)
	# for pciutils
	cp -rf pciutils/lspci $(InstallSbin)
	cp -rf pciutils/setpci $(InstallSbin)
	# for eepro100-diag
	cp -rf eepro100-diag/eepro100-diag $(InstallBin)
	# for tcpdump
	cp -rf tcpdump/usr/local/bin/tcpdump $(InstallBin)
	cp -af /usr/lib/libpcap.so.0.8 /usr/lib/libpcap.so.0.9.5 $(InstallLib)
	# for other
	cp -rf /usr/sbin/arp $(InstallSbin)
	cp -rf /bin/netstat $(InstallBin)
	# for tar
	tar -czf $(Objcet) usr/local

clean:
	for i in $(DependFiles); do $(MAKE) clean -C $$i; done
	rm -rf $(Objcet)
	

dist_clean:clean
	for i in $(DependFiles); do $(MAKE) dist_clean -C $$i; done
	rm -rf usr
	
include ../Makefile.Res
